package cn.school.common.constant.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum PayStatusEnum {
    CREATE(0,"新创建", "success"),
    SUCCESS(1, "已支付", ""),
    CANCEL(2, "已取消", "info"),
    REFUND(3, "已退款", "warning"),
    ;

    /**
     * 获得所有枚举类型到list
     * @return
     */
    public static List<Map<String,Object>> getAllToList() {
        PayStatusEnum[] values = values();
        List<Map<String,Object>> list = new ArrayList<Map<String, Object>>();
        for(PayStatusEnum item:values) {
            Map<String,Object> map = new HashMap();
            map.put("status",item.getStatus());
            map.put("name",item.getName());
            map.put("styleLabel", item.getStyleLabel());
            list.add(map);
        }
        return list;
    }

    PayStatusEnum(Integer status, String name, String styleLabel) {
        this.status = status;
        this.name = name;
        this.styleLabel = styleLabel;
    }

    private Integer status;
    private String name;
    private String styleLabel;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStyleLabel() {
        return styleLabel;
    }

    public void setStyleLabel(String styleLabel) {
        this.styleLabel = styleLabel;
    }
}
